var path = require('path');
var webpack = require('webpack');

module.exports = function(env){
	return {
		entry: {
			main: './index.js',
			// vendor: './node_modules/angular/angular.js'
		},
		output: {
			filename: '[name].js',
			path: path.resolve(__dirname,'dist')
		},
		plugins:[
			new webpack.optimize.CommonsChunkPlugin({
				name:'vendor',
				minChunks:function(module) {
					return module.context &&module .context.indexOf('node_modules') !== -1;
				}
			})
		]
	}
}